\hypertarget{driver__unit__v2_2init_8c}{
\section{driver\_\-unit\_\-v2/init.c File Reference}
\label{driver__unit__v2_2init_8c}\index{driver\_\-unit\_\-v2/init.c@{driver\_\-unit\_\-v2/init.c}}
}
Initialization routines for the driver unit.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{driver__unit__v2_2init_8c_6ce37a080cbe4df58e0938309e4eb207}{
\#define \hyperlink{driver__unit__v2_2init_8c_6ce37a080cbe4df58e0938309e4eb207}{OCR0\_\-1MS}~14}
\label{driver__unit__v2_2init_8c_6ce37a080cbe4df58e0938309e4eb207}

\begin{CompactList}\small\item\em Used for timer compare to match 1 ms. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{driver__unit__v2_2init_8c_64c88f8f419036c766c3b881335d75f4}{init\_\-timer\_\-0} (void)
\item 
void \hyperlink{driver__unit__v2_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}{init\_\-timer\_\-2} (void)
\item 
void \hyperlink{driver__unit__v2_2init_8c_41959d20756307f8b73709871cc2bf47}{init\_\-ports} (void)
\end{CompactItemize}


\subsection{Detailed Description}
Initialization routines for the driver unit. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2009-03-16 

\begin{Code}\begin{verbatim} #include "driver_unit_v2/init.c" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{driver__unit__v2_2init_8c-source}{init.c}.

\subsection{Function Documentation}
\hypertarget{driver__unit__v2_2init_8c_41959d20756307f8b73709871cc2bf47}{
\index{driver\_\-unit\_\-v2/init.c@{driver\_\-unit\_\-v2/init.c}!init\_\-ports@{init\_\-ports}}
\index{init\_\-ports@{init\_\-ports}!driver_unit_v2/init.c@{driver\_\-unit\_\-v2/init.c}}
\subsubsection[{init\_\-ports}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-ports (void)}}
\label{driver__unit__v2_2init_8c_41959d20756307f8b73709871cc2bf47}


Set the direction of the ports 

Definition at line 53 of file init.c.\hypertarget{driver__unit__v2_2init_8c_64c88f8f419036c766c3b881335d75f4}{
\index{driver\_\-unit\_\-v2/init.c@{driver\_\-unit\_\-v2/init.c}!init\_\-timer\_\-0@{init\_\-timer\_\-0}}
\index{init\_\-timer\_\-0@{init\_\-timer\_\-0}!driver_unit_v2/init.c@{driver\_\-unit\_\-v2/init.c}}
\subsubsection[{init\_\-timer\_\-0}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-timer\_\-0 (void)}}
\label{driver__unit__v2_2init_8c_64c88f8f419036c766c3b881335d75f4}


Initialize timer0 to use the main crystal clock and the output compare interrupt feature to generate an interrupt approximately once per millisecond to use as a general purpose time base. 

Definition at line 33 of file init.c.

References OCR0\_\-1MS.\hypertarget{driver__unit__v2_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}{
\index{driver\_\-unit\_\-v2/init.c@{driver\_\-unit\_\-v2/init.c}!init\_\-timer\_\-2@{init\_\-timer\_\-2}}
\index{init\_\-timer\_\-2@{init\_\-timer\_\-2}!driver_unit_v2/init.c@{driver\_\-unit\_\-v2/init.c}}
\subsubsection[{init\_\-timer\_\-2}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-timer\_\-2 (void)}}
\label{driver__unit__v2_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}


Initializes timer 2, used for the communication bus and the interrupt is caught in \hyperlink{bus_8c}{bus.c} 

Definition at line 42 of file init.c.